package filters

import (
	"github.com/beego/beego/v2/core/logs"
	beecontext "github.com/beego/beego/v2/server/web/context"
)

// 过滤器执行方法
func TokenFilter(ctx *beecontext.Context) {
	logs.Info("filter do... ", ctx.Request.Cookies())
	c, err := ctx.Request.Cookie("fxxkToken")
	if err != nil {
		logs.Error("filter err:", err)
		ctx.Abort(559, "xiaosi")
		return
	}

	logs.Info("filter c:", c.Value)
}
